# Create your views here.
from risk.models import *
from risk.serializers import *
from dvadmin.utils.viewset import CustomModelViewSet


class YuqingViewSet(CustomModelViewSet):
    """
    list:查询
    create:新增
    update:修改
    retrieve:单例
    destroy:删除
    """
    queryset = Yuqing.objects.all()
    serializer_class = YuqingSerializer
    create_serializer_class = YuqingCreateUpdateSerializer
    update_serializer_class = YuqingCreateUpdateSerializer
    filter_fields = ['事件标题', '日期','具体产品','危害源','伤害类型','链接']
    search_fields = ['事件标题', '日期','具体产品','危害源','伤害类型','链接']